<template>
  <div>
    <div class="title">
      热销推荐
    </div>
    <ul class="">
      <router-link
        tag="li"
        v-for="recommend in recommendList"
        :key="recommend.id"
        class="item border-bottom"
        :to="'/detail/' + recommend.id"
      >
        <div class="img-container">
          <img class="img-content" :src="recommend.imgUrl" alt="">
        </div>
        <div class="item-info">
          <p class="item-title">{{recommend.title}}</p>
          <p class="item-desc">{{recommend.desc}}</p>
          <button class="item-button">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    recommendList: {
      type: Array
    }
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/mixins.styl'
  .title
    height: .8rem
    line-height .8rem
    text-indent .2rem
    margin-top .2rem
    background-color #F5F5F5
  .item
    overflow hidden
    display flex
    height 1.9rem
    .img-container
      padding .2rem
      height 1.5rem
      width 1.5rem
      .img-content
        width 100%
    .item-info
      flex 1
      padding .1rem
      min-width 0
      .item-title
        line-height .54rem
        font-size .32rem
        ellipise()
      .item-desc
        line-height .4rem
        color #aaa
        ellipise()
      .item-button
        margin-top .2rem
        line-height .44rem
        height .44rem
        padding 0 .1rem
        color #fff
        background-color #FF7950
</style>
